<template>
	<view class="box">
		<view class="top">
			<u-navbar :is-back="true" :title="title" :border-bottom="false"></u-navbar>
		</view>
		<view class="ipg" v-if="image" >
			<image :src="image" mode="widthFix" style="width: 460rpx;"></image>
		</view>
		<view class="codeBox" v-if="code">
			<span>邀请码:</span> <span class="code">{{code}}</span>
		</view>
		<view class="tips container_br">
			<view class="title">
				推广人说明
			</view>
			<view class="content">
				推广人推广新客户并与之账号绑定,客户与推广人绑定后,客户下单购买后的10%总消费金额作为推广人的积分,积分可在积分商城兑换酒品,积分商城兑换的物品在每月的1号和15号统一发货。
			</view>
		</view>
	</view>
</template>

<script>
	import { closeload, toastload } from '../../utils/common';
import {
		getTgImg,
		getKhImg
	} from '@/api/index.js'
	export default {
		data() {
			return {
				title:"",
				image:"",
				code:uni.getStorageSync('code')||''
			};
		},
		onLoad(res) {
			console.log(res);
			if (res.type == 2) {
				this.title = "邀请客户"
				toastload()
				getKhImg().then(res=>{
					console.log(res);
					this.image = res.data
					closeload()
				})
			}else{
				this.title ="招募推广员"
				toastload()
				getTgImg().then(res=>{
					console.log(res);
					this.image = res.data
					closeload()
				})
				
			}
		}
	}
</script>

<style lang="scss">
	.ipg{
		width: 500rpx;
		box-sizing: border-box;
		padding: 20rpx;
		border-radius: 20rpx;
		background-color: #fff;
		margin: 60rpx auto;
	}
	.codeBox{
		text-align: center;
		.code{
			font-weight: 700;
			font-size: 42rpx;
			color: #eb4e38;
		}
	}
	.tips{
	
		.title{
			font-size: 42rpx;
		}
		.content{
			line-height: 58rpx;
			font-size: 32rpx;
			color: #eb4e38;
		}
	}
</style>